<table width="100%">
<caption><h1><?=$caption?></h1><span>添加该产品到<?=form::dropdown('', $categories, '', 'onchange="window.location=\'/product/addcategory/'.$product->id.'/\'+this.value;"')?></span></caption>
<thead>
<tr>
	<th width="5%">ID</th>
	<th width="20%">Name</th>
	<th width="30%">Chinese Title</th>
	<th width="30%">English Title</th>
	<th width="15%">操作</th>
</tr>
</thead>
<tbody id="myTable">
<?php foreach($datas as $data) { ?>
<tr>
	<td><?=$data->id?></td>
	<td><?=$data->name?></td>
	<td><?=$data->title_cn?></td>
	<td><?=$data->title_en?></td>
	<td>
		<?=($product->category_id == $data->id) ? '' : html::anchor('product/delcategory/'.$product->id.'/'.$data->id, 'Remove')?>
		<?=($product->category_id == $data->id) ? '' : html::anchor('product/setcategorydefault/'.$product->id.'/'.$data->id, 'Default')?>
	</td>
</tr>
<?php } ?>
</tbody>
</table>
<?=html::script('js/table.js')?>
